import {Component, OnInit, Input, ViewEncapsulation} from '@angular/core';

@Component({
  selector: 'seed-infinite-scroll-content',
  templateUrl: './seed-infinite-scroll-content.component.html',
  styleUrls: ['./seed-infinite-scroll-content.component.scss'],
  encapsulation: ViewEncapsulation.None,
})
export class SeedInfiniteScrollContent implements OnInit {
  public _loadingText: string;
  public _finishedText: string;
  public _loadingVisibility: boolean;
  public _finishedVisibility: boolean;

  /**
   *@description 设置上拉加载更多提示语句
   * @param text
   */
  @Input()
  set loadingText(text: string) {
    this._loadingText = text;
  }

  get loadingText() {
    return this._loadingText;
  }

  /**
   * @description 设置没有更多数据提示文字
   * @param text
   */
  @Input()
  set finishedText(text: string) {
    this._finishedText = text;
  }

  get finishedText() {
    return this._finishedText;
  }

  /**
   * @description 设置加载更多显示状态
   * @param val
   */
  set loadingVisibility(val: boolean) {
    this._loadingVisibility = val;
  }

  get loadingVisibility() {
    return this._loadingVisibility;
  }

  set finishedVisibility(val: boolean) {
    this._finishedVisibility = val;
  }

  get finishedVisibility() {
    return this._finishedVisibility;
  }

  setFinisheVisibility(val: boolean) {
    this.finishedVisibility = val;
  }

  setLoadingVisibility(val: boolean) {
    this.loadingVisibility = val;
  }

  constructor() {
    /*    this.loadingVisibility = true;
     this.finishedVisibility = false;*/
    this.loadingText = '加载数据中';
    this.finishedText = '没有更多数据了';
  }

  ngOnInit() {
  }

}
